<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
	<title>Get anomaly detection job statistics API | ElasticSearch 7.7 权威指南中文版</title>
	<meta name="keywords" content="ElasticSearch 权威指南中文版, elasticsearch 7, es7, 实时数据分析，实时数据检索" />
    <meta name="description" content="ElasticSearch 权威指南中文版, elasticsearch 7, es7, 实时数据分析，实时数据检索" />
    <!-- Give IE8 a fighting chance -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
	<link rel="stylesheet" type="text/css" href="../static/styles.css" />
	<script>
	var _link = 'ml-get-job-stats.html';
    </script>
</head>
<body>
<div class="main-container">
    <section id="content">
        <div class="content-wrapper">
            <section id="guide" lang="zh_cn">
                <div class="container">
                    <div class="row">
                        <div class="col-xs-12 col-sm-8 col-md-8 guide-section">
                            <div style="color:gray; word-break: break-all; font-size:12px;">原英文版地址: <a href="https://www.elastic.co/guide/en/elasticsearch/reference/7.7/ml-get-job-stats.html" rel="nofollow" target="_blank">https://www.elastic.co/guide/en/elasticsearch/reference/7.7/ml-get-job-stats.html</a>, 原文档版权归 www.elastic.co 所有<br/>本地英文版地址: <a href="../en/ml-get-job-stats.html" rel="nofollow" target="_blank">../en/ml-get-job-stats.html</a></div>
                        <!-- start body -->
                  <div class="page_header">
<strong>重要</strong>: 此版本不会发布额外的bug修复或文档更新。最新信息请参考 <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/index.html" rel="nofollow">当前版本文档</a>。
</div>
<div id="content">
<div class="breadcrumbs">
<span class="breadcrumb-link"><a href="index.html">Elasticsearch Guide [7.7]</a></span>
»
<span class="breadcrumb-link"><a href="rest-apis.html">REST APIs</a></span>
»
<span class="breadcrumb-link"><a href="ml-apis.html">Machine learning anomaly detection APIs</a></span>
»
<span class="breadcrumb-node">Get anomaly detection job statistics API</span>
</div>
<div class="navheader">
<span class="prev">
<a href="ml-get-job.html">« Get anomaly detection jobs API</a>
</span>
<span class="next">
<a href="get-ml-info.html">Get machine learning info API »</a>
</span>
</div>
<div class="section xpack">
<div class="titlepage"><div><div>
<h2 class="title">
<a id="ml-get-job-stats"></a>Get anomaly detection job statistics API<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/ml/anomaly-detection/apis/get-job-stats.asciidoc">edit</a><a class="xpack_tag" href="https://www.elastic.co/subscriptions"></a>
</h2>
</div></div></div>

<p>Retrieves usage information for anomaly detection jobs.</p>
<div class="section">
<div class="titlepage"><div><div>
<h3 class="title">
<a id="ml-get-job-stats-request"></a>Request<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/ml/anomaly-detection/apis/get-job-stats.asciidoc">edit</a>
</h3>
</div></div></div>
<p><code class="literal">GET _ml/anomaly_detectors/&lt;job_id&gt;/_stats</code></p>
<p><code class="literal">GET _ml/anomaly_detectors/&lt;job_id&gt;,&lt;job_id&gt;/_stats</code><br></p>
<p><code class="literal">GET _ml/anomaly_detectors/_stats</code><br></p>
<p><code class="literal">GET _ml/anomaly_detectors/_all/_stats</code></p>
</div>

<div class="section">
<div class="titlepage"><div><div>
<h3 class="title">
<a id="ml-get-job-stats-prereqs"></a>Prerequisites<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/ml/anomaly-detection/apis/get-job-stats.asciidoc">edit</a>
</h3>
</div></div></div>
<div class="ulist itemizedlist">
<ul class="itemizedlist">
<li class="listitem">
If the Elasticsearch security features are enabled, you must have <code class="literal">monitor_ml</code>,
<code class="literal">monitor</code>, <code class="literal">manage_ml</code>, or <code class="literal">manage</code> cluster privileges to use this API. See
<a class="xref" href="security-privileges.html" title="Security privileges">Security privileges</a>.
</li>
</ul>
</div>
</div>

<div class="section">
<div class="titlepage"><div><div>
<h3 class="title">
<a id="ml-get-job-stats-desc"></a>Description<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/ml/anomaly-detection/apis/get-job-stats.asciidoc">edit</a>
</h3>
</div></div></div>
<p>You can get statistics for multiple anomaly detection jobs in a single API request by
using a group name, a comma-separated list of jobs, or a wildcard expression.
You can get statistics for all anomaly detection jobs by using <code class="literal">_all</code>, by specifying <code class="literal">*</code>
as the <code class="literal">&lt;job_id&gt;</code>, or by omitting the <code class="literal">&lt;job_id&gt;</code>.</p>
<div class="important admon">
<div class="icon"></div>
<div class="admon_content">
<p>This API returns a maximum of 10,000 jobs.</p>
</div>
</div>
</div>

<div class="section">
<div class="titlepage"><div><div>
<h3 class="title">
<a id="ml-get-job-stats-path-parms"></a>Path parameters<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/ml/anomaly-detection/apis/get-job-stats.asciidoc">edit</a>
</h3>
</div></div></div>
<div class="variablelist">
<dl class="variablelist">
<dt>
<span class="term">
<code class="literal">&lt;job_id&gt;</code>
</span>
</dt>
<dd>
(Optional, string)
Identifier for the anomaly detection job. It can be a job identifier, a group name, or a
wildcard expression. If you do not specify one of these options, the API returns
information for all anomaly detection jobs.
</dd>
</dl>
</div>
</div>

<div class="section">
<div class="titlepage"><div><div>
<h3 class="title">
<a id="ml-get-job-stats-query-parms"></a>Query parameters<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/ml/anomaly-detection/apis/get-job-stats.asciidoc">edit</a>
</h3>
</div></div></div>
<div class="variablelist">
<dl class="variablelist">
<dt>
<span class="term">
<code class="literal">allow_no_jobs</code>
</span>
</dt>
<dd>
<p>
(Optional, boolean)
Specifies what to do when the request:
</p>
<div class="ulist itemizedlist">
<ul class="itemizedlist">
<li class="listitem">
Contains wildcard expressions and there are no jobs that match.
</li>
<li class="listitem">
Contains the <code class="literal">_all</code> string or no identifiers and there are no matches.
</li>
<li class="listitem">
Contains wildcard expressions and there are only partial matches.
</li>
</ul>
</div>
<p>The default value is <code class="literal">true</code>, which returns an empty <code class="literal">jobs</code> array
when there are no matches and the subset of results when there are partial
matches. If this parameter is <code class="literal">false</code>, the request returns a <code class="literal">404</code> status code
when there are no matches or only partial matches.</p>
</dd>
</dl>
</div>
</div>

<div class="section child_attributes">
<div class="titlepage"><div><div>
<h3 class="title">
<a id="ml-get-job-stats-results"></a>Response body<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/ml/anomaly-detection/apis/get-job-stats.asciidoc">edit</a>
</h3>
</div></div></div>
<p>The API returns the following information about the operational progress of a
job:</p>
<div class="variablelist">
<dl class="variablelist">
<dt>
<span class="term">
<code class="literal">assignment_explanation</code>
</span>
</dt>
<dd>
(string)
For open anomaly detection jobs only, contains messages relating to the selection
of a node to run the job.
</dd>
</dl>
</div>
<div class="variablelist">
<dl class="variablelist">
<dt>
<span class="term">
<a id="datacounts"></a><code class="literal">data_counts</code>
</span>
</dt>
<dd>
<p>
(object) An object that describes the quantity of input to the job and any
related error counts. The <code class="literal">data_count</code> values are cumulative for the lifetime of
a job. If a model snapshot is reverted or old results are deleted, the job
counts are not reset.
</p>
<details open>
<summary class="title">Properties of <code class="literal">data_counts</code></summary>
<div class="content">
<div class="variablelist">
<dl class="variablelist">
<dt>
<span class="term">
<code class="literal">bucket_count</code>
</span>
</dt>
<dd>
(long)
The number of bucket results produced by the job.
</dd>
<dt>
<span class="term">
<code class="literal">earliest_record_timestamp</code>
</span>
</dt>
<dd>
(date)
The timestamp of the earliest chronologically input document.
</dd>
<dt>
<span class="term">
<code class="literal">empty_bucket_count</code>
</span>
</dt>
<dd>
(long)
The number of buckets which did not contain any data. If your data
contains many empty buckets, consider increasing your <code class="literal">bucket_span</code> or using
functions that are tolerant to gaps in data such as <code class="literal">mean</code>, <code class="literal">non_null_sum</code> or
<code class="literal">non_zero_count</code>.
</dd>
<dt>
<span class="term">
<code class="literal">input_bytes</code>
</span>
</dt>
<dd>
(long)
The number of bytes of input data posted to the anomaly detection job.
</dd>
<dt>
<span class="term">
<code class="literal">input_field_count</code>
</span>
</dt>
<dd>
(long)
The total number of fields in input documents posted to the anomaly detection job. This
count includes fields that are not used in the analysis. However, be aware that
if you are using a datafeed, it extracts only the required fields from the
documents it retrieves before posting them to the job.
</dd>
<dt>
<span class="term">
<code class="literal">input_record_count</code>
</span>
</dt>
<dd>
(long)
The number of input documents posted to the anomaly detection job.
</dd>
<dt>
<span class="term">
<code class="literal">invalid_date_count</code>
</span>
</dt>
<dd>
(long)
The number of input documents with either a missing date field or a date that
could not be parsed.
</dd>
<dt>
<span class="term">
<code class="literal">job_id</code>
</span>
</dt>
<dd>
(string)
Identifier for the anomaly detection job.
</dd>
<dt>
<span class="term">
<code class="literal">last_data_time</code>
</span>
</dt>
<dd>
(date)
The timestamp at which data was last analyzed, according to server time.
</dd>
<dt>
<span class="term">
<code class="literal">latest_empty_bucket_timestamp</code>
</span>
</dt>
<dd>
(date)
The timestamp of the last bucket that did not contain any data.
</dd>
<dt>
<span class="term">
<code class="literal">latest_record_timestamp</code>
</span>
</dt>
<dd>
(date)
The timestamp of the latest chronologically input document.
</dd>
<dt>
<span class="term">
<code class="literal">latest_sparse_bucket_timestamp</code>
</span>
</dt>
<dd>
(date)
The timestamp of the last bucket that was considered sparse.
</dd>
<dt>
<span class="term">
<code class="literal">missing_field_count</code>
</span>
</dt>
<dd>
<p>
(long)
The number of input documents that are missing a field that the anomaly detection job is
configured to analyze. Input documents with missing fields are still processed
because it is possible that not all fields are missing.
</p>
<div class="note admon">
<div class="icon"></div>
<div class="admon_content">
<p>If you are using datafeeds or posting data to the job in JSON format, a
high <code class="literal">missing_field_count</code> is often not an indication of data issues. It is not
necessarily a cause for concern.</p>
</div>
</div>
<p>The value of <code class="literal">processed_record_count</code> includes this count.</p>
</dd>
<dt>
<span class="term">
<code class="literal">out_of_order_timestamp_count</code>
</span>
</dt>
<dd>
(long)
The number of input documents that are out of time sequence and outside
of the latency window. This information is applicable only when you provide data
to the anomaly detection job by using the <a class="xref" href="ml-post-data.html" title="Post data to jobs API">post data API</a>. These out of
order documents are  discarded, since jobs require time series data to be in
ascending chronological order.
</dd>
<dt>
<span class="term">
<code class="literal">processed_field_count</code>
</span>
</dt>
<dd>
The total number of fields in all the documents that have been processed by the
anomaly detection job. Only fields that are specified in the detector configuration
object contribute to this count. The timestamp is not included in this count.
</dd>
<dt>
<span class="term">
<code class="literal">processed_record_count</code>
</span>
</dt>
<dd>
(long)
The number of input documents that have been processed by the anomaly detection job.
This value includes documents with missing fields, since they are nonetheless
analyzed. If you use datafeeds and have aggregations in your search query, the
<code class="literal">processed_record_count</code> is the number of aggregation results processed, not the
number of Elasticsearch documents.
</dd>
<dt>
<span class="term">
<code class="literal">sparse_bucket_count</code>
</span>
</dt>
<dd>
(long)
The number of buckets that contained few data points compared to the expected
number of data points. If your data contains many sparse buckets, consider using
a longer <code class="literal">bucket_span</code>.
</dd>
</dl>
</div>
</div>
</details>
</dd>
<dt>
<span class="term">
<code class="literal">deleting</code>
</span>
</dt>
<dd>
(boolean)
Indicates that the process of deleting the job is in progress but not yet
completed. It is only reported when <code class="literal">true</code>.
</dd>
</dl>
</div>
<div class="variablelist">
<dl class="variablelist">
<dt>
<span class="term">
<a id="forecastsstats"></a><code class="literal">forecasts_stats</code>
</span>
</dt>
<dd>
<p>
(object) An object that provides statistical information about forecasts
belonging to this job. Some statistics are omitted if no forecasts have been
made.
</p>
<div class="note admon">
<div class="icon"></div>
<div class="admon_content">
<p>Unless there is at least one forecast, <code class="literal">memory_bytes</code>, <code class="literal">records</code>,
<code class="literal">processing_time_ms</code> and <code class="literal">status</code> properties are omitted.</p>
</div>
</div>
<details open>
<summary class="title">Properties of <code class="literal">forecasts_stats</code></summary>
<div class="content">
<div class="variablelist">
<dl class="variablelist">
<dt>
<span class="term">
<code class="literal">forecasted_jobs</code>
</span>
</dt>
<dd>
(long) A value of <code class="literal">0</code> indicates that forecasts do not exist for this job. A
value of <code class="literal">1</code> indicates that at least one forecast exists.
</dd>
<dt>
<span class="term">
<code class="literal">memory_bytes</code>
</span>
</dt>
<dd>
(object) The <code class="literal">avg</code>, <code class="literal">min</code>, <code class="literal">max</code> and <code class="literal">total</code> memory usage in bytes for forecasts
related to this job. If there are no forecasts, this property is omitted.
</dd>
<dt>
<span class="term">
<code class="literal">processing_time_ms</code>
</span>
</dt>
<dd>
(object) The <code class="literal">avg</code>, <code class="literal">min</code>, <code class="literal">max</code> and <code class="literal">total</code> runtime in milliseconds for
forecasts related to this job. If there are no forecasts, this property is
omitted.
</dd>
<dt>
<span class="term">
<code class="literal">records</code>
</span>
</dt>
<dd>
(object) The <code class="literal">avg</code>, <code class="literal">min</code>, <code class="literal">max</code> and <code class="literal">total</code> number of <code class="literal">model_forecast</code> documents
written for forecasts related to this job. If there are no forecasts, this
property is omitted.
</dd>
<dt>
<span class="term">
<code class="literal">status</code>
</span>
</dt>
<dd>
(object) The count of forecasts by their status. For example:
{"finished" : 2, "started" : 1}. If there are no forecasts, this property is
omitted.
</dd>
<dt>
<span class="term">
<code class="literal">total</code>
</span>
</dt>
<dd>
(long)
The number of individual forecasts currently available for the job. A value of
<code class="literal">1</code> or more indicates that forecasts exist.
</dd>
</dl>
</div>
</div>
</details>
</dd>
<dt>
<span class="term">
<code class="literal">job_id</code>
</span>
</dt>
<dd>
(string)
Identifier for the anomaly detection job.
</dd>
</dl>
</div>
<div class="variablelist">
<dl class="variablelist">
<dt>
<span class="term">
<a id="modelsizestats"></a><code class="literal">model_size_stats</code>
</span>
</dt>
<dd>
<p>
(object) An object that provides information about the size and contents of the
model.
</p>
<details open>
<summary class="title">Properties of <code class="literal">model_size_stats</code></summary>
<div class="content">
<div class="variablelist">
<dl class="variablelist">
<dt>
<span class="term">
<code class="literal">bucket_allocation_failures_count</code>
</span>
</dt>
<dd>
(long)
The number of buckets for which new entities in incoming data were not processed
due to insufficient model memory. This situation is also signified by a
<code class="literal">hard_limit: memory_status</code> property value.
</dd>
<dt>
<span class="term">
<code class="literal">categorized_doc_count</code>
</span>
</dt>
<dd>
(long)
The number of documents that have had a field categorized.
</dd>
<dt>
<span class="term">
<code class="literal">categorization_status</code>
</span>
</dt>
<dd>
<p>
(string)
The status of categorization for the job. Contains one of the following values:
</p>
<div class="ulist itemizedlist">
<ul class="itemizedlist">
<li class="listitem">
<code class="literal">ok</code>: Categorization is performing acceptably well (or not being used at all).
</li>
<li class="listitem">
<code class="literal">warn</code>: Categorization is detecting a distribution of categories that suggests
the input data is inappropriate for categorization. Problems could be that there
is only one category, more than 90% of categories are rare, the number of
categories is greater than 50% of the number of categorized documents, there are
no frequently matched categories, or more than 50% of categories are dead.
</li>
</ul>
</div>
</dd>
<dt>
<span class="term">
<code class="literal">dead_category_count</code>
</span>
</dt>
<dd>
(long)
The number of categories created by categorization that will never be assigned
again because another category’s definition makes it a superset of the dead
category. (Dead categories are a side effect of the way categorization has no
prior training.)
</dd>
<dt>
<span class="term">
<code class="literal">frequent_category_count</code>
</span>
</dt>
<dd>
(long)
The number of categories that match more than 1% of categorized documents.
</dd>
<dt>
<span class="term">
<code class="literal">job_id</code>
</span>
</dt>
<dd>
(string)
Identifier for the anomaly detection job.
</dd>
<dt>
<span class="term">
<code class="literal">log_time</code>
</span>
</dt>
<dd>
(date) The timestamp of the <code class="literal">model_size_stats</code> according to server time.
</dd>
<dt>
<span class="term">
<code class="literal">memory_status</code>
</span>
</dt>
<dd>
<p>
(string)
The status of the mathematical models, which can have one of the following
values:
</p>
<div class="ulist itemizedlist">
<ul class="itemizedlist">
<li class="listitem">
<code class="literal">ok</code>: The models stayed below the configured value.
</li>
<li class="listitem">
<code class="literal">soft_limit</code>: The models used more than 60% of the configured memory limit
and older unused models will be pruned to free up space.
</li>
<li class="listitem">
<code class="literal">hard_limit</code>: The models used more space than the configured memory limit.
As a result, not all incoming data was processed.
</li>
</ul>
</div>
</dd>
<dt>
<span class="term">
<code class="literal">model_bytes</code>
</span>
</dt>
<dd>
(long)
The number of bytes of memory used by the models. This is the maximum value
since the last time the model was persisted. If the job is closed, this value
indicates the latest size.
</dd>
<dt>
<span class="term">
<code class="literal">model_bytes_exceeded</code>
</span>
</dt>
<dd>
(long)
The number of bytes over the high limit for memory usage at the last allocation
failure.
</dd>
<dt>
<span class="term">
<code class="literal">model_bytes_memory_limit</code>
</span>
</dt>
<dd>
(long)
The upper limit for model memory usage, checked on increasing values.
</dd>
<dt>
<span class="term">
<code class="literal">rare_category_count</code>
</span>
</dt>
<dd>
(long)
The number of categories that match just one categorized document.
</dd>
<dt>
<span class="term">
<code class="literal">result_type</code>
</span>
</dt>
<dd>
(string) For internal use. The type of result.
</dd>
<dt>
<span class="term">
<code class="literal">total_by_field_count</code>
</span>
</dt>
<dd>
(long)
The number of <code class="literal">by</code> field values that were analyzed by the models. This value is
cumulative for all detectors in the job.
</dd>
<dt>
<span class="term">
<code class="literal">total_category_count</code>
</span>
</dt>
<dd>
(long)
The number of categories created by categorization.
</dd>
<dt>
<span class="term">
<code class="literal">total_over_field_count</code>
</span>
</dt>
<dd>
(long)
The number of <code class="literal">over</code> field values that were analyzed by the models. This value
is cumulative for all detectors in the job.
</dd>
<dt>
<span class="term">
<code class="literal">total_partition_field_count</code>
</span>
</dt>
<dd>
(long)
The number of <code class="literal">partition</code> field values that were analyzed by the models. This
value is cumulative for all detectors in the job.
</dd>
<dt>
<span class="term">
<code class="literal">timestamp</code>
</span>
</dt>
<dd>
(date)
The timestamp of the last record when the model stats were gathered.
</dd>
</dl>
</div>
</div>
</details>
</dd>
</dl>
</div>
<div class="variablelist">
<dl class="variablelist">
<dt>
<span class="term">
<a id="stats-node"></a><code class="literal">node</code>
</span>
</dt>
<dd>
<p>
(object) Contains properties for the node that runs the job. This information is
available only for open jobs.
</p>
<details open>
<summary class="title">Properties of <code class="literal">node</code></summary>
<div class="content">
<div class="variablelist">
<dl class="variablelist">
<dt>
<span class="term">
<code class="literal">attributes</code>
</span>
</dt>
<dd>
(object)
Lists node attributes such as <code class="literal">ml.machine_memory</code> or <code class="literal">ml.max_open_jobs</code> settings.
</dd>
<dt>
<span class="term">
<code class="literal">ephemeral_id</code>
</span>
</dt>
<dd>
(string)
The ephemeral ID of the node.
</dd>
<dt>
<span class="term">
<code class="literal">id</code>
</span>
</dt>
<dd>
(string)
The unique identifier of the node.
</dd>
<dt>
<span class="term">
<code class="literal">name</code>
</span>
</dt>
<dd>
(string)
The node name.
</dd>
<dt>
<span class="term">
<code class="literal">transport_address</code>
</span>
</dt>
<dd>
(string)
The host and port where transport HTTP connections are accepted.
</dd>
</dl>
</div>
</div>
</details>
</dd>
<dt>
<span class="term">
<code class="literal">open_time</code>
</span>
</dt>
<dd>
(string)
For open jobs only, the elapsed time for which the job has been open.
</dd>
<dt>
<span class="term">
<code class="literal">state</code>
</span>
</dt>
<dd>
<p>
(string)
The status of the anomaly detection job, which can be one of the following values:
</p>
<div class="ulist itemizedlist">
<ul class="itemizedlist">
<li class="listitem">
<code class="literal">closed</code>: The job finished successfully with its model state persisted. The
job must be opened before it can accept further data.
</li>
<li class="listitem">
<code class="literal">closing</code>: The job close action is in progress and has not yet completed. A
closing job cannot accept further data.
</li>
<li class="listitem">
<code class="literal">failed</code>: The job did not finish successfully due to an error. This situation
can occur due to invalid input data, a fatal error occurring during the
analysis, or an external interaction such as the process being killed by the
Linux out of memory (OOM) killer. If the job had irrevocably failed, it must be
force closed and then deleted. If the datafeed can be corrected, the job can be
closed and then re-opened.
</li>
<li class="listitem">
<code class="literal">opened</code>: The job is available to receive and process data.
</li>
<li class="listitem">
<code class="literal">opening</code>: The job open action is in progress and has not yet completed.
</li>
</ul>
</div>
</dd>
</dl>
</div>
<div class="variablelist">
<dl class="variablelist">
<dt>
<span class="term">
<a id="timingstats"></a><code class="literal">timing_stats</code>
</span>
</dt>
<dd>
<p>
(object) An object that provides statistical information about timing aspect of
this job.
</p>
<details open>
<summary class="title">Properties of <code class="literal">timing_stats</code></summary>
<div class="content">
<div class="variablelist">
<dl class="variablelist">
<dt>
<span class="term">
<code class="literal">average_bucket_processing_time_ms</code>
</span>
</dt>
<dd>
(double) Average of all bucket processing times in milliseconds.
</dd>
<dt>
<span class="term">
<code class="literal">bucket_count</code>
</span>
</dt>
<dd>
(long)
The number of buckets processed.
</dd>
<dt>
<span class="term">
<code class="literal">exponential_average_bucket_processing_time_ms</code>
</span>
</dt>
<dd>
(double)
Exponential moving average of all bucket processing times, in milliseconds.
</dd>
<dt>
<span class="term">
<code class="literal">exponential_average_bucket_processing_time_per_hour_ms</code>
</span>
</dt>
<dd>
(double)
Exponentially-weighted moving average of bucket processing times
calculated in a 1 hour time window, in milliseconds.
</dd>
<dt>
<span class="term">
<code class="literal">job_id</code>
</span>
</dt>
<dd>
(string)
Identifier for the anomaly detection job.
</dd>
<dt>
<span class="term">
<code class="literal">maximum_bucket_processing_time_ms</code>
</span>
</dt>
<dd>
(double)
Maximum among all bucket processing times, in milliseconds.
</dd>
<dt>
<span class="term">
<code class="literal">minimum_bucket_processing_time_ms</code>
</span>
</dt>
<dd>
(double)
Minimum among all bucket processing times, in milliseconds.
</dd>
<dt>
<span class="term">
<code class="literal">total_bucket_processing_time_ms</code>
</span>
</dt>
<dd>
(double)
Sum of all bucket processing times, in milliseconds.
</dd>
</dl>
</div>
</div>
</details>
</dd>
</dl>
</div>
</div>

<div class="section">
<div class="titlepage"><div><div>
<h3 class="title">
<a id="ml-get-job-stats-response-codes"></a>Response codes<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/ml/anomaly-detection/apis/get-job-stats.asciidoc">edit</a>
</h3>
</div></div></div>
<div class="variablelist">
<dl class="variablelist">
<dt>
<span class="term">
<code class="literal">404</code> (Missing resources)
</span>
</dt>
<dd>
If <code class="literal">allow_no_jobs</code> is <code class="literal">false</code>, this code indicates that there are no
resources that match the request or only partial matches for the request.
</dd>
</dl>
</div>
</div>

<div class="section">
<div class="titlepage"><div><div>
<h3 class="title">
<a id="ml-get-job-stats-example"></a>Examples<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/ml/anomaly-detection/apis/get-job-stats.asciidoc">edit</a>
</h3>
</div></div></div>
<div class="pre_wrapper lang-console">
<pre class="programlisting prettyprint lang-console">GET _ml/anomaly_detectors/low_request_rate/_stats</pre>
</div>
<div class="console_widget" data-snippet="snippets/1825.console"></div>
<p>The API returns the following results:</p>
<div class="pre_wrapper lang-js">
<pre class="programlisting prettyprint lang-js">{
  "count" : 1,
  "jobs" : [
    {
      "job_id" : "low_request_rate",
      "data_counts" : {
        "job_id" : "low_request_rate",
        "processed_record_count" : 1216,
        "processed_field_count" : 1216,
        "input_bytes" : 51678,
        "input_field_count" : 1216,
        "invalid_date_count" : 0,
        "missing_field_count" : 0,
        "out_of_order_timestamp_count" : 0,
        "empty_bucket_count" : 242,
        "sparse_bucket_count" : 0,
        "bucket_count" : 1457,
        "earliest_record_timestamp" : 1575172659612,
        "latest_record_timestamp" : 1580417369440,
        "last_data_time" : 1576017595046,
        "latest_empty_bucket_timestamp" : 1580356800000,
        "input_record_count" : 1216
      },
      "model_size_stats" : {
        "job_id" : "low_request_rate",
        "result_type" : "model_size_stats",
        "model_bytes" : 41480,
        "model_bytes_exceeded" : 0,
        "model_bytes_memory_limit" : 10485760,
        "total_by_field_count" : 3,
        "total_over_field_count" : 0,
        "total_partition_field_count" : 2,
        "bucket_allocation_failures_count" : 0,
        "memory_status" : "ok",
        "categorized_doc_count" : 0,
        "total_category_count" : 0,
        "frequent_category_count" : 0,
        "rare_category_count" : 0,
        "dead_category_count" : 0,
        "categorization_status" : "ok",
        "log_time" : 1576017596000,
        "timestamp" : 1580410800000
      },
      "forecasts_stats" : {
        "total" : 1,
        "forecasted_jobs" : 1,
        "memory_bytes" : {
          "total" : 9179.0,
          "min" : 9179.0,
          "avg" : 9179.0,
          "max" : 9179.0
        },
        "records" : {
          "total" : 168.0,
          "min" : 168.0,
          "avg" : 168.0,
          "max" : 168.0
        },
        "processing_time_ms" : {
          "total" : 40.0,
          "min" : 40.0,
          "avg" : 40.0,
          "max" : 40.0
        },
        "status" : {
          "finished" : 1
        }
      },
      "state" : "opened",
      "node" : {
        "id" : "7bmMXyWCRs-TuPfGJJ_yMw",
        "name" : "node-0",
        "ephemeral_id" : "hoXMLZB0RWKfR9UPPUCxXX",
        "transport_address" : "127.0.0.1:9300",
        "attributes" : {
          "ml.machine_memory" : "17179869184",
          "xpack.installed" : "true",
          "ml.max_open_jobs" : "20"
        }
      },
      "assignment_explanation" : "",
      "open_time" : "13s",
      "timing_stats" : {
        "job_id" : "low_request_rate",
        "bucket_count" : 1457,
        "total_bucket_processing_time_ms" : 1094.000000000001,
        "minimum_bucket_processing_time_ms" : 0.0,
        "maximum_bucket_processing_time_ms" : 48.0,
        "average_bucket_processing_time_ms" : 0.75085792724777,
        "exponential_average_bucket_processing_time_ms" : 0.5571716855800993,
        "exponential_average_bucket_processing_time_per_hour_ms" : 15.0
      }
    }
  ]
}</pre>
</div>
</div>

</div>
<div class="navfooter">
<span class="prev">
<a href="ml-get-job.html">« Get anomaly detection jobs API</a>
</span>
<span class="next">
<a href="get-ml-info.html">Get machine learning info API »</a>
</span>
</div>
</div>

                  <!-- end body -->
                        </div>
                        <div class="col-xs-12 col-sm-4 col-md-4" id="right_col">
                        
                        </div>
                    </div>
                </div>
            </section>
        </div>
    </section>
</div>
<script src="../static/cn.js"></script>
</body>
</html>